//
//  ConsulationAnsedListCellModel.m
//  EnvironmentalProtection
//
//  Created by HCreater on 2018/11/22.
//  Copyright © 2018年 HCreater. All rights reserved.
//

#import "ConsulationAnsedListCellModel.h"

@interface ConsulationAnsedListCellModel()

@end

@implementation ConsulationAnsedListCellModel

- (instancetype)initWithData:(id)data cellHeight:(CGFloat)cellHeight
{
    self = [super init];
    if (self)
    {
        _data = data;
        
        /// cellHeight+2（2容错）
        _cellHeight = MHUIScaleValue(cellHeight)+2;
        
        @weakify(self);
        [[RACObserve(self, data) distinctUntilChanged] subscribeNext:^(id x)
         {
             @strongify(self);
             
             ConsulationListData* curData = x;
             
             self.ask = curData.title;
             self.answer = @"缺少参数";
             self.time = curData.addTime;
             self.answerNum = HCStrFormat(@"%@个解答", curData.replyCount);
         }];
    }
    
    return self;
}

@end
